package com.mxpio.erp.common.quality.entity;

import com.mxpioframework.jpa.annotation.DictAble;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;


@Data
@Entity
@Table(name = "V_MB_ERP_QUALITY_MO_SCRAP_OUT_SUM")
@Schema(description="生产订单不良退料+成品质检不合格最终报废汇总 视图")
@NoArgsConstructor
@AllArgsConstructor
public class MoScrapOutFlowSum implements DictAble , Serializable {
    private static final long serialVersionUID = 1L;

    /*@Column(name = "id")
    @Schema(description = "id")
    private String id;

    @Column(name = "MAIN_WORKSHOP_")
    @Schema(description = "主制车间")
    @Dict(dicCode = "workShopCode",dicEntity = WorkShop.class,dicText = "workShopName")
    private String mainWorkshop;

    @Column(name = "ITEM_CODE_")
    @Schema(description = "物料代码")
    private String itemCode;*/

    @Column(name = "ITEM_NAME_")
    @Schema(description = "物料名称")
    private String itemName ;

    @Id
    @Column(name = "DRAWING_NO_")
    @Schema(description = "图号")
    private String drawingNo;

    /*@Column(name = "CREATE_YEAR")
    @Schema(description = "业务年份")
    private String createYear;*/

    @Column(name = "QUANTITY_")
    @Schema(description = "流水数量(报废)")//验收单确认数量
    private BigDecimal quantity;

    @Transient
    private Map<String, String> textMap;

    public String putText(String key, String value) {
        if (textMap == null) {
            textMap = new HashMap<>();
        }
        return textMap.put(key, value);
    }

}
